#!/bin/bash

# 默认使用 patch，也可通过参数指定：./publish.sh minor
VERSION_TYPE=${1:-patch}

echo "🔧 Updating version ($VERSION_TYPE)..."
npm version $VERSION_TYPE || exit 1

echo "🚀 Publishing to npm..."
npm publish || exit 1

echo "✅ Publish complete."